<html>
	<head>
		<title>Districts</title>
	</head>
	<body>
		<?php
			include_once("adb.php");
			class district extends adb{
			
				function district(){
					adb::adb();
				}
				
				function list_all(){
					$query = "SELECT *FROM district";
					return $this -> query($query);
				}
				
				function insert_district($_id, $_name, $_capital, $_region_id){
					$query = "INSERT INTO district(district_id, district_name, district_capital, region_id) VALUES ($_id, '$_name', '$_capital', $_region_id)";
					return $this -> query($query);
				}
				
				function delete_row($_name){
					$query = "DELETE *FROM district WHERE district_name = '$_name'";
					return $this -> query($query);
				}
				
				function update_district($_id, $_name, $_capital, $_region_id){
					$query = "UPDATE district SET district_name = '$_name', district_capital = '$_capital', region_id = $_region_id WHERE $district_id = $_id";
					return $this -> query($query);
				}
				
				function search_district($_id){
					$query = "SELECT district_id, district_name, district_capital, region_id FROM district WHERE district_id = $_id";
					return $this -> query($query);
				}
			}
		?>
	</body>
</html>